from env_tools import get_env_value
from langchain_deepseek import ChatDeepSeek

# 获取环境变量
api_key = get_env_value("DEEPSEEK_API_KEY")
if api_key is None:
    raise ValueError("请设置环境变量DEEPSEEK_API_KEY")

# 创建模型
model = ChatDeepSeek(
    model = "deepseek-chat",            # 模型名称
    api_key = api_key,
    max_tokens=None,
    temperature=0,
    max_retries=2
)

# 问题列表
questions= [
    "1+1等于几?",
    "Python与Java当前哪个语言更流行?",
    "你是哪家公司的模型?"
]
# 批量调用使用batch
responses = model.batch(questions)
for q, r in zip(questions, responses):
    print(q, "\n", r)

